package com.ld.control.business.task.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ld.control.business.task.service.SubTaskExampleService;
import com.ld.control.business.task.service.TaskExampleService;
import com.ld.control.business.task.vo.req.TaskExampleReqVo;
import com.ld.control.business.task.vo.req.TaskExampleSearchReqVo;
import com.ld.control.business.task.vo.resp.SubTaskExampleRespVo;
import com.ld.control.business.task.vo.resp.TaskExampleRespVo;
import com.ld.control.common.ResultResponse;
import com.ld.control.common.vo.GenerateListVo;
import com.ld.control.common.vo.GeneratePageListVo;
import com.ld.control.sysenum.ResultResponseEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 任务模板表 前端控制器
 * </p>
 *
 * @author wangfeng
 * @since 2024-05-09
 */
@Slf4j
@Tag(name = "子任务实例相关接口")
@RestController
public class SubTaskExampleController {

    @Autowired
    private SubTaskExampleService subTaskExampleService;

    @GetMapping("/api/centralControl/subTaskExample/getList")
    @Operation(summary = "子任务实例列表")
    public ResultResponse<GenerateListVo<SubTaskExampleRespVo>> getList(
            @RequestParam Long taskExampleId
    ) {
        List<SubTaskExampleRespVo> subTaskExampleRespVoList = subTaskExampleService.getListByTaskExampleModelId(taskExampleId);
        return ResultResponse.success(new GenerateListVo<>(subTaskExampleRespVoList));
    }

}

